"""
CSV 写入示例
"""

from devtools import debug

from utils.csv_utils import CSVReader
from utils.data_utils import ExcelHeaderInfo


def _get_fake_data() -> list[ExcelHeaderInfo]:
    """ 获取假数据 """

    header_info_list: list[ExcelHeaderInfo] = [
        ExcelHeaderInfo("序号", "idx", int),
        ExcelHeaderInfo("姓名", "name", str),
        ExcelHeaderInfo("性别", "gender", str),
        ExcelHeaderInfo("手机号", "phone", str),
        ExcelHeaderInfo("邮箱", "email", str),
        ExcelHeaderInfo("地址", "address", str),
    ]
    """ 标题信息列表 """

    return header_info_list


def read_data_from_excel():
    """ 从指定 Excel 文件读取数据 """

    header_info_list = _get_fake_data()
    file_name: str = "./_csv_writer_demo_file.csv"

    handler: CSVReader = CSVReader(
        file_name=file_name,
        header_info_list=header_info_list,
    )
    """ CSVReader 实例 """

    # 读取数据
    res = handler.read()
    debug(res)


if __name__ == "__main__":
    read_data_from_excel()
